<template>
  <view class="container">
    <z-paging
      ref="paging"
      v-model="itemList"
      @query="queryList"
      :fixed="true"
      :auto="false"
      :auto-show-back-to-top="true"
      :empty-view-img="`${getImageUrl('empty.png')} `"
      empty-view-text="暂无数据~"
      :empty-view-img-style="imgStyle"
    >
      <view slot="top">
        <u-navbar height="50" title="实时转售" title-size="36" title-color="#333"></u-navbar>
        <view class="searchView">
          <u-search placeholder="搜索商品或自提点" v-model="keyword"></u-search>
        </view>
      </view>
      <view
        class="itemListView"
        v-for="(item, index) in itemList"
        :key="index"
        @click="onDetail(item)"
      >
        <scroll-view class="scrollView" :scroll-x="true" :show-scrollbar="false" :enhanced="true">
          <view class="merchant-box">
            <view
              class="merchant-box-item"
              v-for="(item2, index2) in item.goods"
              :key="index2"
              @click="onFlashDetails(item2)"
            >
              <u-image
                width="170"
                height="140"
                src="/static/logo.png"
                border-radius="8rpx 8rpx 0rpx 0px"
              ></u-image>
              <view class="goodsTitle u-line-2">秘鲁A级即食牛油果3颗</view>
            </view>
          </view>
        </scroll-view>
        <view class="itemView">
          <view class="itemTitle">自提点：购物中心3F-1号自提柜</view>
          <view class="itemText">贵阳市南明区花果园大街购物中心3-F露天平台</view>
        </view>
        <view class="totalNum">共6样商品</view>
        <view class="itemBtnView">
          <view class="itemPrice">当前转售价 ¥<text>46.00</text></view>
          <view class="itemBtn">立即捡漏</view>
        </view>
      </view>
    </z-paging>
  </view>
</template>

<script>
export default {
  data() {
    return {
      imgStyle: {
        width: '12rem'
      },
      keyword: '',
      itemList: [
        {
          goods: [{}, {}, {}, {}]
        },
        {
          goods: [{}, {}, {}, {}]
        }
      ]
    }
  },
  methods: {
    queryList(page, pageSize) {
      this.$refs.paging.complete(this.itemList)
    }
  }
}
</script>

<style>
@import url('realtime-resale.css');

page {
  background: #f5f5f5;
}
</style>
